package com.yangmao.service.impl;

import com.github.pagehelper.PageHelper;
import com.yangmao.dao.DiseasesDao;
import com.yangmao.entity.Diseases;
import com.yangmao.service.api.DiseasesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ‘洋毛’
 * @version 1.0
 * @description: TODO
 * @date 2022/1/11 16:37
 */
@Service
public class DiseasesServiceImpl implements DiseasesService {
    @Autowired
    private DiseasesDao Diseasesdao;

    @Override
    public List<Diseases> getAllDiseases(int page, int size) {
        PageHelper.startPage(page,size);
        return Diseasesdao.getAllDiseases();
    }

    @Override
    public void updateDiseases(Diseases Diseases) {
        Diseasesdao.updateDiseases(Diseases);
    }

    @Override
    public void deleteDiseases(String id) {
        Diseasesdao.deleteDiseases(id);
    }

    @Override
    public void addDiseases(Diseases Diseases) {
        Diseasesdao.addDiseases(Diseases);
    }

    @Override
    public Diseases getDiseasesById(String id) {
        return Diseasesdao.getDiseasesById(id);
    }
}
